using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VTPORDER
    {
        public DataRow Convert2TPORDER(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryTPORDER(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["TPOMANDANT"] = " ".PadRight(2 ); 
         dwReturn["TPOID"] = " ".PadRight(8 ); 
         dwReturn["TPOAENDZL"] = " ".PadRight(0 ); 
         dwReturn["TPOAENDBEN"] = " ".PadRight(8 ); 
         dwReturn["TPOAENDDAT"] = " ".PadRight(0 ); 
         dwReturn["TPOAENDZT"] = " ".PadRight(0 ); 
         dwReturn["TPONEUBEN"] = " ".PadRight(8 ); 
         dwReturn["TPONEUDAT"] = " ".PadRight(0 ); 
         dwReturn["TPONEUZT"] = " ".PadRight(0 ); 
         dwReturn["TPOTYP"] = " ".PadRight(1 ); 
         dwReturn["TPOTUID"] = " ".PadRight(8 ); 
         dwReturn["TPOTUTYP"] = " ".PadRight(4 ); 
         dwReturn["TPOTUHEIGHT"] = " ".PadRight(0 ); 
         dwReturn["TPOMINTUHT"] = " ".PadRight(0 ); 
         dwReturn["TPOMAXTUHT"] = " ".PadRight(0 ); 
         dwReturn["TPOTUWEIGHT"] = " ".PadRight(0 ); 
         dwReturn["TPOMINTUWT"] = " ".PadRight(0 ); 
         dwReturn["TPOMAXTUWT"] = " ".PadRight(0 ); 
         dwReturn["TPOFREZ"] = " ".PadRight(1 ); 
         dwReturn["TPOSRULE"] = " ".PadRight(0 ); 
         dwReturn["TPOVLO"] = " ".PadRight(2 ); 
         dwReturn["TPOVLB"] = " ".PadRight(2 ); 
         dwReturn["TPOVLP"] = " ".PadRight(8 ); 
         dwReturn["TPOALO"] = " ".PadRight(2 ); 
         dwReturn["TPOALB"] = " ".PadRight(2 ); 
         dwReturn["TPOALP"] = " ".PadRight(8 ); 
         dwReturn["TPOZLO"] = " ".PadRight(2 ); 
         dwReturn["TPOZLB"] = " ".PadRight(2 ); 
         dwReturn["TPOZLP"] = " ".PadRight(8 ); 
         dwReturn["TPOPRIO"] = " ".PadRight(0 ); 
         dwReturn["TPOGROUPID"] = " ".PadRight(8 ); 
         dwReturn["TPOSUBGOUP"] = " ".PadRight(0 ); 
         dwReturn["TPOSEQNO"] = " ".PadRight(0 ); 
         dwReturn["TPOSGORDER"] = " ".PadRight(1 ); 
         dwReturn["TPOSQORDER"] = " ".PadRight(1 ); 
         dwReturn["TPONOTOIG"] = " ".PadRight(0 ); 
         dwReturn["TPOINFO"] = " ".PadRight(30 ); 
         dwReturn["TPOPROCES"] = " ".PadRight(20 ); 
         dwReturn["TPOSTA"] = " ".PadRight(1 ); 
         dwReturn["TPOPLO"] = " ".PadRight(2 ); 
         dwReturn["TPOPLB"] = " ".PadRight(2 ); 
         dwReturn["TPOPLP"] = " ".PadRight(8 ); 
         dwReturn["TPOSTPCOMP"] = " ".PadRight(12 ); 
         dwReturn["TPOBTUID"] = " ".PadRight(8 ); 
         dwReturn["TPOMNR"] = " ".PadRight(4 ); 
         dwReturn["TPOMPAR1"] = " ".PadRight(40 ); 
         dwReturn["TPOMPAR2"] = " ".PadRight(20 ); 
         dwReturn["TPORC1"] = " ".PadRight(0 ); 
         dwReturn["TPORC2"] = " ".PadRight(0 ); 
         dwReturn["TPORC3"] = " ".PadRight(0 ); 
         dwReturn["TPORC4"] = " ".PadRight(0 ); 
         dwReturn["TPORC5"] = " ".PadRight(0 ); 
         dwReturn["TPORC6"] = " ".PadRight(0 ); 
         dwReturn["TPORC7"] = " ".PadRight(0 ); 
         dwReturn["TPORC8"] = " ".PadRight(0 ); 
         dwReturn["TPORC9"] = " ".PadRight(0 ); 
         dwReturn["TPOTRPROC"] = " ".PadRight(2 ); 
         dwReturn["TPOSTPLNR"] = " ".PadRight(3 ); 
         dwReturn["TPORUEZT"] = " ".PadRight(0 ); 
         dwReturn["TPOKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["TPOSTKNR"] = " ".PadRight(12 ); 
         dwReturn["TPOBERDAT"] = " ".PadRight(0 ); 
         dwReturn["TPOBERZT"] = " ".PadRight(0 ); 
         dwReturn["TPOMNRKRS"] = " ".PadRight(2 ); 
         dwReturn["TPOMLFDNR"] = " ".PadRight(4 ); 
         dwReturn["TPOMPOS"] = " ".PadRight(2 ); 
         dwReturn["TPOAUFTYP"] = " ".PadRight(1 ); 
         dwReturn["TPOAUFKRS"] = " ".PadRight(2 ); 
         dwReturn["TPOAUFLFD"] = " ".PadRight(6 ); 
         dwReturn["TPOAUFPOS"] = " ".PadRight(3 ); 
         dwReturn["TPOAFOLGE"] = " ".PadRight(3 ); 
         dwReturn["TPOTP"] = " ".PadRight(4 ); 
         dwReturn["TPOLIEFSCH"] = " ".PadRight(8 ); 
         dwReturn["TPOTUNNEL"] = " ".PadRight(1 ); 
         dwReturn["TPORUNNER"] = " ".PadRight(1 ); 
         dwReturn["TPOCOM"] = " ".PadRight(80 ); 
         dwReturn["TPORELPAL"] = " ".PadRight(1 ); 
         dwReturn["TPOSTORNO"] = " ".PadRight(1 ); 
         dwReturn["TPONEUPROG"] = " ".PadRight(8 ); 
         dwReturn["TPOAENDPROG"] = " ".PadRight(8 ); 
         dwReturn["TPOWAKZ"] = " ".PadRight(1 ); 
         dwReturn["TPOBLOCK"] = " ".PadRight(2 ); 
         dwReturn["TPOLOAD"] = " ".PadRight(4 ); 
         dwReturn["TPORMTYPE"] = " ".PadRight(1 ); 
         dwReturn["TPOSTPGRP"] = " ".PadRight(3 ); 
         dwReturn["TPOFILLER"] = " ".PadRight(20 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapTPORDER(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveTPORDER(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryTPORDER(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapTPORDER(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertTPORDER(dwLocal, ITXDBVERSION);
            }
            UpdateTPORDER(dwLocal);
        }
        public void InsertTPORDER(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO TPORDER(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryTPORDER(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM TPORDER WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM TPORDER  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "TPORDER";
            Return = Result;
            return Return;
        }
        public void DeleteTPORDER(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM TPORDER   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateTPORDER(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE TPORDER SET "
                    +"TPOMANDANT= :TPOMANDANT,"
                    +"TPOID= :TPOID,"
                    +"TPOAENDZL= :TPOAENDZL,"
                    +"TPOAENDBEN= :TPOAENDBEN,"
                    +"TPOAENDDAT= :TPOAENDDAT,"
                    +"TPOAENDZT= :TPOAENDZT,"
                    +"TPONEUBEN= :TPONEUBEN,"
                    +"TPONEUDAT= :TPONEUDAT,"
                    +"TPONEUZT= :TPONEUZT,"
                    +"TPOTYP= :TPOTYP,"
                    +"TPOTUID= :TPOTUID,"
                    +"TPOTUTYP= :TPOTUTYP,"
                    +"TPOTUHEIGHT= :TPOTUHEIGHT,"
                    +"TPOMINTUHT= :TPOMINTUHT,"
                    +"TPOMAXTUHT= :TPOMAXTUHT,"
                    +"TPOTUWEIGHT= :TPOTUWEIGHT,"
                    +"TPOMINTUWT= :TPOMINTUWT,"
                    +"TPOMAXTUWT= :TPOMAXTUWT,"
                    +"TPOFREZ= :TPOFREZ,"
                    +"TPOSRULE= :TPOSRULE,"
                    +"TPOVLO= :TPOVLO,"
                    +"TPOVLB= :TPOVLB,"
                    +"TPOVLP= :TPOVLP,"
                    +"TPOALO= :TPOALO,"
                    +"TPOALB= :TPOALB,"
                    +"TPOALP= :TPOALP,"
                    +"TPOZLO= :TPOZLO,"
                    +"TPOZLB= :TPOZLB,"
                    +"TPOZLP= :TPOZLP,"
                    +"TPOPRIO= :TPOPRIO,"
                    +"TPOGROUPID= :TPOGROUPID,"
                    +"TPOSUBGOUP= :TPOSUBGOUP,"
                    +"TPOSEQNO= :TPOSEQNO,"
                    +"TPOSGORDER= :TPOSGORDER,"
                    +"TPOSQORDER= :TPOSQORDER,"
                    +"TPONOTOIG= :TPONOTOIG,"
                    +"TPOINFO= :TPOINFO,"
                    +"TPOPROCES= :TPOPROCES,"
                    +"TPOSTA= :TPOSTA,"
                    +"TPOPLO= :TPOPLO,"
                    +"TPOPLB= :TPOPLB,"
                    +"TPOPLP= :TPOPLP,"
                    +"TPOSTPCOMP= :TPOSTPCOMP,"
                    +"TPOBTUID= :TPOBTUID,"
                    +"TPOMNR= :TPOMNR,"
                    +"TPOMPAR1= :TPOMPAR1,"
                    +"TPOMPAR2= :TPOMPAR2,"
                    +"TPORC1= :TPORC1,"
                    +"TPORC2= :TPORC2,"
                    +"TPORC3= :TPORC3,"
                    +"TPORC4= :TPORC4,"
                    +"TPORC5= :TPORC5,"
                    +"TPORC6= :TPORC6,"
                    +"TPORC7= :TPORC7,"
                    +"TPORC8= :TPORC8,"
                    +"TPORC9= :TPORC9,"
                    +"TPOTRPROC= :TPOTRPROC,"
                    +"TPOSTPLNR= :TPOSTPLNR,"
                    +"TPORUEZT= :TPORUEZT,"
                    +"TPOKUNDNR= :TPOKUNDNR,"
                    +"TPOSTKNR= :TPOSTKNR,"
                    +"TPOBERDAT= :TPOBERDAT,"
                    +"TPOBERZT= :TPOBERZT,"
                    +"TPOMNRKRS= :TPOMNRKRS,"
                    +"TPOMLFDNR= :TPOMLFDNR,"
                    +"TPOMPOS= :TPOMPOS,"
                    +"TPOAUFTYP= :TPOAUFTYP,"
                    +"TPOAUFKRS= :TPOAUFKRS,"
                    +"TPOAUFLFD= :TPOAUFLFD,"
                    +"TPOAUFPOS= :TPOAUFPOS,"
                    +"TPOAFOLGE= :TPOAFOLGE,"
                    +"TPOTP= :TPOTP,"
                    +"TPOLIEFSCH= :TPOLIEFSCH,"
                    +"TPOTUNNEL= :TPOTUNNEL,"
                    +"TPORUNNER= :TPORUNNER,"
                    +"TPOCOM= :TPOCOM,"
                    +"TPORELPAL= :TPORELPAL,"
                    +"TPOSTORNO= :TPOSTORNO,"
                    +"TPONEUPROG= :TPONEUPROG,"
                    +"TPOAENDPROG= :TPOAENDPROG,"
                    +"TPOWAKZ= :TPOWAKZ,"
                    +"TPOBLOCK= :TPOBLOCK,"
                    +"TPOLOAD= :TPOLOAD,"
                    +"TPORMTYPE= :TPORMTYPE,"
                    +"TPOSTPGRP= :TPOSTPGRP,"
                    +"TPOFILLER= :TPOFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("TPOMANDANT", OracleType.NVarChar).Value = dwData["TPOMANDANT"].ToString(); 
          or1.Parameters.Add("TPOID", OracleType.NVarChar).Value = dwData["TPOID"].ToString(); 
          or1.Parameters.Add("TPOAENDZL", OracleType.NVarChar).Value = dwData["TPOAENDZL"].ToString(); 
          or1.Parameters.Add("TPOAENDBEN", OracleType.NVarChar).Value = dwData["TPOAENDBEN"].ToString(); 
          or1.Parameters.Add("TPOAENDDAT", OracleType.NVarChar).Value = dwData["TPOAENDDAT"].ToString(); 
          or1.Parameters.Add("TPOAENDZT", OracleType.NVarChar).Value = dwData["TPOAENDZT"].ToString(); 
          or1.Parameters.Add("TPONEUBEN", OracleType.NVarChar).Value = dwData["TPONEUBEN"].ToString(); 
          or1.Parameters.Add("TPONEUDAT", OracleType.NVarChar).Value = dwData["TPONEUDAT"].ToString(); 
          or1.Parameters.Add("TPONEUZT", OracleType.NVarChar).Value = dwData["TPONEUZT"].ToString(); 
          or1.Parameters.Add("TPOTYP", OracleType.NVarChar).Value = dwData["TPOTYP"].ToString(); 
          or1.Parameters.Add("TPOTUID", OracleType.NVarChar).Value = dwData["TPOTUID"].ToString(); 
          or1.Parameters.Add("TPOTUTYP", OracleType.NVarChar).Value = dwData["TPOTUTYP"].ToString(); 
          or1.Parameters.Add("TPOTUHEIGHT", OracleType.NVarChar).Value = dwData["TPOTUHEIGHT"].ToString(); 
          or1.Parameters.Add("TPOMINTUHT", OracleType.NVarChar).Value = dwData["TPOMINTUHT"].ToString(); 
          or1.Parameters.Add("TPOMAXTUHT", OracleType.NVarChar).Value = dwData["TPOMAXTUHT"].ToString(); 
          or1.Parameters.Add("TPOTUWEIGHT", OracleType.NVarChar).Value = dwData["TPOTUWEIGHT"].ToString(); 
          or1.Parameters.Add("TPOMINTUWT", OracleType.NVarChar).Value = dwData["TPOMINTUWT"].ToString(); 
          or1.Parameters.Add("TPOMAXTUWT", OracleType.NVarChar).Value = dwData["TPOMAXTUWT"].ToString(); 
          or1.Parameters.Add("TPOFREZ", OracleType.NVarChar).Value = dwData["TPOFREZ"].ToString(); 
          or1.Parameters.Add("TPOSRULE", OracleType.NVarChar).Value = dwData["TPOSRULE"].ToString(); 
          or1.Parameters.Add("TPOVLO", OracleType.NVarChar).Value = dwData["TPOVLO"].ToString(); 
          or1.Parameters.Add("TPOVLB", OracleType.NVarChar).Value = dwData["TPOVLB"].ToString(); 
          or1.Parameters.Add("TPOVLP", OracleType.NVarChar).Value = dwData["TPOVLP"].ToString(); 
          or1.Parameters.Add("TPOALO", OracleType.NVarChar).Value = dwData["TPOALO"].ToString(); 
          or1.Parameters.Add("TPOALB", OracleType.NVarChar).Value = dwData["TPOALB"].ToString(); 
          or1.Parameters.Add("TPOALP", OracleType.NVarChar).Value = dwData["TPOALP"].ToString(); 
          or1.Parameters.Add("TPOZLO", OracleType.NVarChar).Value = dwData["TPOZLO"].ToString(); 
          or1.Parameters.Add("TPOZLB", OracleType.NVarChar).Value = dwData["TPOZLB"].ToString(); 
          or1.Parameters.Add("TPOZLP", OracleType.NVarChar).Value = dwData["TPOZLP"].ToString(); 
          or1.Parameters.Add("TPOPRIO", OracleType.NVarChar).Value = dwData["TPOPRIO"].ToString(); 
          or1.Parameters.Add("TPOGROUPID", OracleType.NVarChar).Value = dwData["TPOGROUPID"].ToString(); 
          or1.Parameters.Add("TPOSUBGOUP", OracleType.NVarChar).Value = dwData["TPOSUBGOUP"].ToString(); 
          or1.Parameters.Add("TPOSEQNO", OracleType.NVarChar).Value = dwData["TPOSEQNO"].ToString(); 
          or1.Parameters.Add("TPOSGORDER", OracleType.NVarChar).Value = dwData["TPOSGORDER"].ToString(); 
          or1.Parameters.Add("TPOSQORDER", OracleType.NVarChar).Value = dwData["TPOSQORDER"].ToString(); 
          or1.Parameters.Add("TPONOTOIG", OracleType.NVarChar).Value = dwData["TPONOTOIG"].ToString(); 
          or1.Parameters.Add("TPOINFO", OracleType.NVarChar).Value = dwData["TPOINFO"].ToString(); 
          or1.Parameters.Add("TPOPROCES", OracleType.NVarChar).Value = dwData["TPOPROCES"].ToString(); 
          or1.Parameters.Add("TPOSTA", OracleType.NVarChar).Value = dwData["TPOSTA"].ToString(); 
          or1.Parameters.Add("TPOPLO", OracleType.NVarChar).Value = dwData["TPOPLO"].ToString(); 
          or1.Parameters.Add("TPOPLB", OracleType.NVarChar).Value = dwData["TPOPLB"].ToString(); 
          or1.Parameters.Add("TPOPLP", OracleType.NVarChar).Value = dwData["TPOPLP"].ToString(); 
          or1.Parameters.Add("TPOSTPCOMP", OracleType.NVarChar).Value = dwData["TPOSTPCOMP"].ToString(); 
          or1.Parameters.Add("TPOBTUID", OracleType.NVarChar).Value = dwData["TPOBTUID"].ToString(); 
          or1.Parameters.Add("TPOMNR", OracleType.NVarChar).Value = dwData["TPOMNR"].ToString(); 
          or1.Parameters.Add("TPOMPAR1", OracleType.NVarChar).Value = dwData["TPOMPAR1"].ToString(); 
          or1.Parameters.Add("TPOMPAR2", OracleType.NVarChar).Value = dwData["TPOMPAR2"].ToString(); 
          or1.Parameters.Add("TPORC1", OracleType.NVarChar).Value = dwData["TPORC1"].ToString(); 
          or1.Parameters.Add("TPORC2", OracleType.NVarChar).Value = dwData["TPORC2"].ToString(); 
          or1.Parameters.Add("TPORC3", OracleType.NVarChar).Value = dwData["TPORC3"].ToString(); 
          or1.Parameters.Add("TPORC4", OracleType.NVarChar).Value = dwData["TPORC4"].ToString(); 
          or1.Parameters.Add("TPORC5", OracleType.NVarChar).Value = dwData["TPORC5"].ToString(); 
          or1.Parameters.Add("TPORC6", OracleType.NVarChar).Value = dwData["TPORC6"].ToString(); 
          or1.Parameters.Add("TPORC7", OracleType.NVarChar).Value = dwData["TPORC7"].ToString(); 
          or1.Parameters.Add("TPORC8", OracleType.NVarChar).Value = dwData["TPORC8"].ToString(); 
          or1.Parameters.Add("TPORC9", OracleType.NVarChar).Value = dwData["TPORC9"].ToString(); 
          or1.Parameters.Add("TPOTRPROC", OracleType.NVarChar).Value = dwData["TPOTRPROC"].ToString(); 
          or1.Parameters.Add("TPOSTPLNR", OracleType.NVarChar).Value = dwData["TPOSTPLNR"].ToString(); 
          or1.Parameters.Add("TPORUEZT", OracleType.NVarChar).Value = dwData["TPORUEZT"].ToString(); 
          or1.Parameters.Add("TPOKUNDNR", OracleType.NVarChar).Value = dwData["TPOKUNDNR"].ToString(); 
          or1.Parameters.Add("TPOSTKNR", OracleType.NVarChar).Value = dwData["TPOSTKNR"].ToString(); 
          or1.Parameters.Add("TPOBERDAT", OracleType.NVarChar).Value = dwData["TPOBERDAT"].ToString(); 
          or1.Parameters.Add("TPOBERZT", OracleType.NVarChar).Value = dwData["TPOBERZT"].ToString(); 
          or1.Parameters.Add("TPOMNRKRS", OracleType.NVarChar).Value = dwData["TPOMNRKRS"].ToString(); 
          or1.Parameters.Add("TPOMLFDNR", OracleType.NVarChar).Value = dwData["TPOMLFDNR"].ToString(); 
          or1.Parameters.Add("TPOMPOS", OracleType.NVarChar).Value = dwData["TPOMPOS"].ToString(); 
          or1.Parameters.Add("TPOAUFTYP", OracleType.NVarChar).Value = dwData["TPOAUFTYP"].ToString(); 
          or1.Parameters.Add("TPOAUFKRS", OracleType.NVarChar).Value = dwData["TPOAUFKRS"].ToString(); 
          or1.Parameters.Add("TPOAUFLFD", OracleType.NVarChar).Value = dwData["TPOAUFLFD"].ToString(); 
          or1.Parameters.Add("TPOAUFPOS", OracleType.NVarChar).Value = dwData["TPOAUFPOS"].ToString(); 
          or1.Parameters.Add("TPOAFOLGE", OracleType.NVarChar).Value = dwData["TPOAFOLGE"].ToString(); 
          or1.Parameters.Add("TPOTP", OracleType.NVarChar).Value = dwData["TPOTP"].ToString(); 
          or1.Parameters.Add("TPOLIEFSCH", OracleType.NVarChar).Value = dwData["TPOLIEFSCH"].ToString(); 
          or1.Parameters.Add("TPOTUNNEL", OracleType.NVarChar).Value = dwData["TPOTUNNEL"].ToString(); 
          or1.Parameters.Add("TPORUNNER", OracleType.NVarChar).Value = dwData["TPORUNNER"].ToString(); 
          or1.Parameters.Add("TPOCOM", OracleType.NVarChar).Value = dwData["TPOCOM"].ToString(); 
          or1.Parameters.Add("TPORELPAL", OracleType.NVarChar).Value = dwData["TPORELPAL"].ToString(); 
          or1.Parameters.Add("TPOSTORNO", OracleType.NVarChar).Value = dwData["TPOSTORNO"].ToString(); 
          or1.Parameters.Add("TPONEUPROG", OracleType.NVarChar).Value = dwData["TPONEUPROG"].ToString(); 
          or1.Parameters.Add("TPOAENDPROG", OracleType.NVarChar).Value = dwData["TPOAENDPROG"].ToString(); 
          or1.Parameters.Add("TPOWAKZ", OracleType.NVarChar).Value = dwData["TPOWAKZ"].ToString(); 
          or1.Parameters.Add("TPOBLOCK", OracleType.NVarChar).Value = dwData["TPOBLOCK"].ToString(); 
          or1.Parameters.Add("TPOLOAD", OracleType.NVarChar).Value = dwData["TPOLOAD"].ToString(); 
          or1.Parameters.Add("TPORMTYPE", OracleType.NVarChar).Value = dwData["TPORMTYPE"].ToString(); 
          or1.Parameters.Add("TPOSTPGRP", OracleType.NVarChar).Value = dwData["TPOSTPGRP"].ToString(); 
          or1.Parameters.Add("TPOFILLER", OracleType.NVarChar).Value = dwData["TPOFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
